import React, { Component } from "react";
import PropTypes from "prop-types";

class TodoHeader extends Component {
  static propTypes = {
    addTodo:PropTypes.func.isRequired
  }
  render() {
    return (
      <div className="todo-header">
        <input type="text"
          placeholder="请输入你的任务名称，按回车键确认"
          onKeyUp={this.props.addTodo}
        />
      </div>
    );
  }
}

export default TodoHeader;
